import camera from '@/three/camera'
import renderer from '@/three/renderer'

window.addEventListener('resize', () => {
  const width = window.innerWidth
  const height = window.innerHeight
  // 更新摄像头
  camera.aspect = width / height
  // 更新摄像机的投影矩阵
  camera.updateProjectionMatrix()
  // 更新渲染器
  renderer.setSize(width, height)
  // 更新渲染器像素比
  renderer.setPixelRatio(window.devicePixelRatio)
})
